SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vwactadesignacion
AS
SELECT     TOP 100 PERCENT dbo.tb_Vacantes.idVacante, dbo.tb_NivelesEnsenanza.NivelEnsenanza AS Nivel, dbo.tb_Concursos.Descripcion AS Concurso, 
                      dbo.tb_Agentes.Nombres, dbo.tb_Agentes.Documento, dbo.tb_TiposDeDocumento.Descripcion AS TipoDeDocumento, 
                      dbo.tb_Vacantes.PuntajeDesignacion, dbo.tb_Vacantes.OrdenDesignacion, dbo.tb_Organizaciones.Nombre AS Organizacion, 
                      dbo.tb_Organizaciones.CUISE, dbo.tb_Plazas.CUPOF, dbo.tb_Turnos.Descripcion AS Turno, dbo.tb_Localidades.localidad, 
                      dbo.tb_CargosGenericos.Descripcion AS CargoGenerico, dbo.tb_NivelesEnsenanza.idNivelEnsenanza
FROM         dbo.tb_Localidades INNER JOIN
                      dbo.tb_Vacantes INNER JOIN
                      dbo.tb_Concursos ON dbo.tb_Vacantes.Concurso = dbo.tb_Concursos.idConcurso ON 
                      dbo.tb_Localidades.idLocalidad = dbo.tb_Vacantes.Localidad LEFT OUTER JOIN
                      dbo.tb_TiposDeDocumento INNER JOIN
                      dbo.tb_Agentes ON dbo.tb_TiposDeDocumento.idTipoDocumento = dbo.tb_Agentes.TipoDocumento ON 
                      dbo.tb_Vacantes.AgenteDesignado = dbo.tb_Agentes.idAgente LEFT OUTER JOIN
                      dbo.tb_NivelesEnsenanza ON dbo.tb_Concursos.Nivel = dbo.tb_NivelesEnsenanza.idNivelEnsenanza LEFT OUTER JOIN
                      dbo.tb_Plazas INNER JOIN
                      dbo.tb_Turnos ON dbo.tb_Plazas.Turno = dbo.tb_Turnos.idTurno INNER JOIN
                      dbo.tb_TraslacionDeCYA INNER JOIN
                      dbo.tb_CargosGenericos ON dbo.tb_TraslacionDeCYA.CargoGenerico = dbo.tb_CargosGenericos.idCargoGenerico ON 
                      dbo.tb_Plazas.Asignatura = dbo.tb_TraslacionDeCYA.Asignatura AND 
                      dbo.tb_Plazas.CargoSalarialDefault = dbo.tb_TraslacionDeCYA.Cargo LEFT OUTER JOIN
                      dbo.tb_Organizaciones ON dbo.tb_Plazas.Organizacion = dbo.tb_Organizaciones.idOrganizaciones ON 
                      dbo.tb_Vacantes.Plaza = dbo.tb_Plazas.idPlaza
ORDER BY dbo.tb_Vacantes.idVacante
GO
GRANT SELECT ON  [dbo].[vwactadesignacion] TO [CentroDeDesignaciones]
GRANT SELECT ON  [dbo].[vwactadesignacion] TO [SoloVer]
GO
EXEC sp_addextendedproperty N'MS_DiagramPane1', N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1[50] 2[25] 3) )"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1 [56] 4 [18] 2))"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = -96
         Left = 0
      End
      Begin Tables = 
         Begin Table = "tb_Localidades"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 114
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Vacantes"
            Begin Extent = 
               Top = 6
               Left = 265
               Bottom = 114
               Right = 468
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Concursos"
            Begin Extent = 
               Top = 6
               Left = 506
               Bottom = 114
               Right = 695
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_TiposDeDocumento"
            Begin Extent = 
               Top = 6
               Left = 733
               Bottom = 84
               Right = 922
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Agentes"
            Begin Extent = 
               Top = 84
               Left = 733
               Bottom = 192
               Right = 934
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_NivelesEnsenanza"
            Begin Extent = 
               Top = 114
               Left = 38
               Bottom = 192
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Plazas"
            Begin Extent = 
               Top = 114
               Left = 265
               Bottom = 222
               Right = 495
      ', 'USER', N'dbo', 'VIEW', N'vwactadesignacion', NULL, NULL
GO
EXEC sp_addextendedproperty N'MS_DiagramPane2', N'      End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Turnos"
            Begin Extent = 
               Top = 114
               Left = 533
               Bottom = 207
               Right = 722
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_TraslacionDeCYA"
            Begin Extent = 
               Top = 192
               Left = 38
               Bottom = 300
               Right = 227
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_CargosGenericos"
            Begin Extent = 
               Top = 192
               Left = 760
               Bottom = 300
               Right = 949
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "tb_Organizaciones"
            Begin Extent = 
               Top = 210
               Left = 533
               Bottom = 318
               Right = 722
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      RowHeights = 220
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'USER', N'dbo', 'VIEW', N'vwactadesignacion', NULL, NULL
GO
DECLARE @xp int
SELECT @xp=2
EXEC sp_addextendedproperty N'MS_DiagramPaneCount', @xp, 'USER', N'dbo', 'VIEW', N'vwactadesignacion', NULL, NULL
GO
